Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom attribute to store blockquote depth on iOS #564

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

tomekzaw
Copy link
Collaborator

@tomekzaw tomekzaw commented Dec 5, 2024

Details

This PR removes _blockquoteRangesAndLevels in RCTMarkdownUtils in favor of storing the blockquote depth as NSNumber under custom attribute named RCTLiveMarkdownBlockquoteDepth.

This removes cohesion between _blockquoteRangesAndLevels and applyRangeToAttributedString: which I plan to move to a separate class called MarkdownFormatter in an upcoming PR.

It also simplifies the implementation of MarkdownLayoutManager where now we can use [textStorage attribute:atIndex:effectiveRange:]; to check if given range is a blockquote and determine its depth without custom algorithms.

Partially applies #520.

Related Issues

GH_LINK

Manual Tests

Linked PRs

@tomekzaw tomekzaw requested a review from j-piasecki December 5, 2024 16:16
@tomekzaw tomekzaw changed the title Obtain blockquotes ranges and levels from markdownRanges on iOS Use custom attribute to store blockquote depth on iOS Dec 5, 2024
@tomekzaw tomekzaw requested review from j-piasecki and removed request for j-piasecki December 5, 2024 21:27
@tomekzaw tomekzaw merged commit 5cd6617 into main Dec 6, 2024
5 checks passed
@tomekzaw tomekzaw deleted the @tomekzaw/ios-blockquote-ranges-and-levels branch December 6, 2024 08:09
@os-botify
Copy link
Contributor

os-botify bot commented Dec 6, 2024

🚀 Published to npm in 0.1.198 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants